package collection;

import java.util.*;


public class testCollection {
	
	private final Harry TEST123 = new Harry("gjll");
	

	public static void main(String[] args) {
		
		
		List<String> lst = new ArrayList<String>();
		lst = new LinkedList<String>();
		//Stack (LIFO)
		//Queue (FIFO)
				
		Set<String> set = new HashSet<String>();
		set.add("1");
		set.add("1");
		System.out.println(set);
		
		Set<Harry> setHarry = new HashSet<Harry>();
		setHarry.add(new Harry("test"));     //45
		setHarry.add(new Harry("test"));	//true 45
		System.out.println(setHarry);
		//equals and hashcode
		
		
		Set<Integer> setInt = new TreeSet<Integer>();
		setInt.add(4);
		setInt.add(1);
		setInt.add(5);
		setInt.add(2);
		System.out.println(setInt);
		
		
		Set<String> setString = new TreeSet<String>();
		setString.add("4");
		setString.add("11");
		setString.add("aa");
		setString.add("b");
		setString.add("5");
		setString.add("2");
		setString.add("a");
		System.out.println(setString);
		
		
		
		
		Map<String, String> hm = new HashMap<String, String>();
		hm.put("bye", "harry");
		hm.put("hi", "harry");
		hm.put("test", "harry");
	String removed = 	hm.remove("hi");
	System.out.println("removed: "+removed);
		System.out.println(hm);
		
		
		String st;
		Map<String, String> hm1 = new TreeMap<String, String>();
		hm1.put("bye", "harry");
		System.out.println("bye".hashCode());
		hm1.put("bye", "mahi");
		System.out.println("bye".hashCode());
		hm1.put("test", "harry");
		System.out.println("test".hashCode());
		hm1.put("test1", "harry");
		System.out.println("test1".hashCode());
		hm1.put("abc", "harry");
		System.out.println("abc".hashCode());
		System.out.println(hm1);
		
		String str = hm.get("bye1");   //34
		System.out.println(str);
		
		//equals and hashcode
		
//		java create set of keys
//		and list of values
		
//		34
//		["test" -> "test1" -> "bye" -> abc]   ["hi" ]   [ "bye1111"  ]    [   ]
		
		
		
		Map<String, Harry> hmHarry = new HashMap<String, Harry>();
		hmHarry.put("11", new Harry("test1"));
		hmHarry.put("22", new Harry("test2"));
		hmHarry.put("3", new Harry("test4"));
		
		Map<Harry, String> hmHarry1 = new HashMap<Harry, String>();
		Harry harry = new Harry("abc");
		hmHarry1.put(harry, "123");
		hmHarry1.put(new Harry("hi"), "456");
		hmHarry1.put(new Harry("bye"), "456");
		hmHarry1.put(new Harry("test"), "456");
		System.out.println(hmHarry1);
		Object obj;
		
//		Collections
		
		Harry harry2 = new Harry("cfsd");
		Harry harry3 = new Harry("cfsd");
		System.out.println("1111111:::::"+harry.hashCode());
		System.out.println("222222:::::"+harry2.hashCode());
		System.out.println("333333:::::"+harry3.hashCode());
		
		Stack<String> stack = new Stack<String>();
		Vector<String> vc = new Vector<String>();
		
		
		Hashtable<String , String> hm = new Hashtable<String, String>();
		
	}
}
